package com.ycy.chuwenuniapp.controller;

import com.alibaba.fastjson2.JSONObject;
import com.ycy.chuwenuniapp.common.ResData;
import com.ycy.chuwenuniapp.entity.User;
import com.ycy.chuwenuniapp.service.LoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "小程序登录")
@RestController
public class LoginController {
    @Resource
    private LoginService loginService;

    @GetMapping("/login")
    @ApiOperation("登录")
    public ResData<User> uniAppLogin(String code) {
        return loginService.uniAppLogin(code);
    }
}
